import request from "@/utils/request";
//请求登录的接口
export const loginApi = (data)=>{
    let {username,password} = data;

    let formdata = new FormData();
    formdata.append("username",username);
    formdata.append("password",password);

    return request.post("/api/auth/login",formdata);
}
//请求注册的接口地址
export const register = (data)=>{
    return request({
        url:"/api/auth/register",
        method:"post",
        data
    })
}


//获取当前用户信息
export const getUserInfo = ()=>{
    return request({
        url:"/api/auth/info",
        method:"get"
    })
}

//修改用户的基本信息
export const updateUser = (data)=>{
    return request({
        url:`/api/auth/info/${data.id}`,
        method:"put",
        data,
    })
}

//获取聊天用户列表
export const getChatUsers = ()=>{
    return request({
        url:`/api/auth//member/list`,
        method:"get",
    })
}